﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter21.Models.SynchronizationSamples
{
    using System.Threading;

    public class Job
    {
        private SharedState sharedState;

        public Job(SharedState sharedState)
        {
            this.sharedState = sharedState;
        }

        public void DoTheJob()
        {
            for (int i = 0; i < 50000; i++)
            {
                sharedState.IncrementStateInterlocked();
            }
        }
    }
}
